angular.module('mamApp').factory('DataManager', ['$http', 'api', 'paramsManager', function ($http, api, paramsManager) {
    var DataManager = {

        /**
         * cp  统计
         * @param params query
         * @returns
         */

        cpCountStat: function (params,query) {
            return $http.get(api+'/admin/cpCountStat/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * cp  新增统计
         * @param params query
         * @returns
         */

        cpNewAddedCountStat: function (params,query) {
            return $http.get(api+'/admin/newCpCountStat/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * cp  新增月统计
         * @param params query
         * @returns
         */

        cpNewAddedMonthCountStat: function (params,query) {
            return $http.get(api+'/admin/newCpCountStat/month/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 新增专辑
         * @param params query
         * @returns
         */

        albumNewAddedCountStat: function (params,query) {
            return $http.get(api+'/admin/albumNewStats/'+paramsManager.params(params)+paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

        /**
         * 专辑概况统计
         * @param params query
         * @returns
         */

        albumCountStat: function (params, query) {
            return $http.get(api + '/admin/albumSummaryStats/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

        /**
         * 专辑概况统计折线图
         * @param params query
         * @returns
         */

        albumChartData: function () {
            return $http.get(api + '/admin/albumSummaryStats').then(function (result) {
                return result;
            });
        },

        /**
         * 节目概况统计
         * @param params query
         * @returns
         */

        programsCountStat: function (params, query) {
            return $http.get(api + '/admin/programSummaryStats/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 节目概况统计折线图
         * @param params query
         * @returns
         */

        programsChartData: function () {
            return $http.get(api + '/admin/programSummaryStats').then(function (result) {
                return result;
            });
        },
        /**
         * 节目新增统计
         * @param params query
         * @returns
         */

        programsNewAddedStat: function (params, query) {
            return $http.get(api + '/admin/programNewStats/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 节目新增统计折线图
         * @param 
         * @returns
         */

        programsNewAddChartData: function () {
            return $http.get(api + '/admin/programNewStats').then(function (result) {
                return result;
            });
        },
        /**
         * 专辑新增统计折线图
         * @param
         * @returns
         */

        albumNewAddChartData: function () {
            return $http.get(api + '/admin/albumNewStats').then(function (result) {
                return result;
            });
        },
        /**
         * 平台播放总计
         * @param 
         * @returns
         */
        appPlayOverviewStat: function (params) {
            return $http.get(api + '/admin/stat/play/playChannel/' +paramsManager.params(params)).then(function (result) {
                return result;
            });


        },

        /**
         * 一级频道播放列表
         * @param params query
         * @returns
         */

        oneLevelChannelPlayList: function (params, query) {
            return $http.get(api + '/admin/stat/play/category/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

        /**
         * 二级频道播放列表
         * @param params query
         * @returns
         */

        twoLevelChannelPlayList: function (params, query) {
            return $http.get(api + '/admin/stat/play/category/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

        /**
         * 二级频道播放详情
         * @param params query
         * @returns
         */

        twoLevelChannelPlayDetail: function (params, query) {
            return $http.get(api + '/admin/stat/play/category/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

        /**
         * cp播放统计
         * @param params query
         * @returns
         */

        cpPlayOverviewStat: function (params, query) {
            return $http.get(api + '/admin/stat/play/cp/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

        /**
         * cp播放量明细
         * @param params query
         * @returns
         */

        cpPlayOverviewDetailStat: function (params, query) {
            return $http.get(api + '/admin/stat/play/cp/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },

        /**
         * 渠道播放总计
         * @param 
         * @returns
         */
         channelPlayOverviewStat: function (params) {
            return $http.get(api + '/admin/stat/play/playChannel/' +paramsManager.params(params)).then(function (result) {
                return result;
            });
        },
        /**
         * 渠道播放详情统计
         * @param 
         * @returns
         */
         channelPlayOverviewDetails: function (params, query) {
            return $http.get(api + '/admin/stat/play/playChannel/' +paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },


        /**
         * 播放概况统计
         * @param params query
         * @returns
         */

       playCountStat: function (params, query) {
            return $http.get(api + '/admin/stat/play/count/' + paramsManager.params(params) + paramsManager.query(query)).then(function (result) {
                return result;
            });
        },
        /**
         * 专辑总量
         * @param
         * @returns
         */

        playData: function () {
            return $http.get(api + '/admin/stat/play/playcount/total').then(function (result) {
                return result;
            });
        }


    };



    return DataManager;
}]);

